/**
 * 评论请求模块
 */
import request from '@/utils/request'
/**
 * 获取文章评论列表
 * @param {*} params 参数id
 */
export const getCommentList = params => {
  return request({
    method: 'GET',
    url: '/app/v1_0/comments',
    params
  })
}

/**
 * 对评论进行点赞
 * @param {*} target 评论的id
 */
export const addCommentLike = target => {
  return request({
    url: '/app/v1_0/comment/likings',
    method: 'POST',
    data: {
      target
    }
  })
}
/**
 * 取消评论点赞
 * @param {*} target 评论的id
 */
export const deleteCommentLike = target => {
  return request({
    url: '/app/v1_0/comment/likings/' + target,
    method: 'DELETE'
  })
}

/**
 * 发布评论
 * @param {*} target 发布评论的参数
 */
export const postComment = data => {
  return request({
    url: '/app/v1_0/comments',
    method: 'POST',
    data
  })
}
